<!--Gordana Pejic 191/01-->
<?php 
    require '../pages/db.php';
    $con=dbConnect("sib");

    $hid=$_GET["hid"];
    $result=mysql_query("SELECT * FROM hostel WHERE IDHostel='$hid'", $con);
    $row=mysql_fetch_array($result);

    $name=$row["Name"];
    $address=$row["Address"];
    $latitute=$row["Latitude"];
    $longitude=$row["Longitude"];
    $pricemin=$row["PriceMin"];
    $pricemax=$row["PriceMax"];
    $rooms=$row["NumOfRooms"];
    $beds=$row["NumOfBeds"];
    $toilets=$row["NumOfToilets"];
    $included=$row["IncludedInPrice"];
    $reception=$row["Reception"];
    $web=$row["WebAccess"];
    $fooddrink=$row["FoodDrink"];
    $inroom=$row["InRoom"];
    $todo=$row["ThingsToDo"];
    $general=$row["General"];
    $desc=$row["Description"];
    $email=$row["Email"];

echo '
<div class="admin-hostels">
    <div class="admin-title">
        <h1>Edit hostel</h1>
    </div>

    <div class="admin-content">
          <form name="add-event" action="pages/add_admin_hostel-edit.php?hid='.$hid.'" method="post">
            <table align="center">
            <tr>
                <td>Name: </td>
                <td><input type="text" name="name" value="'.$name.'" /></td>
            </tr>
            <tr>
                <td>Address:</td>
                <td><input type="text" name="address" value="'.$address.'"></td>
            </tr>
            <tr>
                <td>Owner e-mail:</td>
                <td><input type="text" name="email" value="'.$email.'"></td>
            </tr>
            <tr>
                <td>Longitude:</td>
                <td><input type="text" name="long" value="'.$longitude.'"></td>
            </tr>
            <tr>
                <td>LAtitude:</td>
                <td><input type="text" name="lat" value="'.$latitute.'"></td>
            </tr>
             <tr>
                <td>Price min:</td>
                <td><input type="text" name="pricemin" value="'.$pricemin.'"></td>
            </tr>
             <tr>
                <td>Price max:</td>
                <td><input type="text" name="pricemax" value="'.$pricemax.'"></td>
            </tr>
            <tr>
                <td>Number of rooms:</td>
                <td><input type="text" name="rooms" value="'.$rooms.'"></td>
            </tr>
            <tr>
                <td>Number of beds:</td>
                <td><input type="text" name="beds" value="'.$beds.'"></td>
            </tr>
           <tr>
                <td>Number of toilets: </td>
                <td><input type="text" name="toilets" value="'.$toilets.'"></td>
            </tr>
            <tr>
                <td colspan="2">Included in price: </td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="included" rows="4" cols="50" >'.$included.'</textarea></td>
            </tr>

            <tr>
                <td colspan="2">Reception: </td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="reception" rows="4" cols="50">'.$reception.'</textarea></td>
            </tr>

            <tr>
                <td colspan="2">Web access: </td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="web" rows="4" cols="50">'.$web.'</textarea></td>
            </tr>

            <tr>
                <td colspan="2">Food/drink: </td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="food" rows="4" cols="50">'.$fooddrink.'</textarea></td>
            </tr>

            <tr>
                <td colspan="2">In room: </td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="inroom" rows="4" cols="50">'.$inroom.'</textarea></td>
            </tr>

            <tr>
                <td colspan="2">Things to do: </td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="todo" rows="4" cols="50">'.$todo.'</textarea></td>
            </tr>

            <tr>
                <td colspan="2">General: </td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="general" rows="4" cols="50">'.$general.'</textarea></td>
            </tr>

            <tr>
                <td colspan="2">Description: </td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="desc" rows="4" cols="50">'.$desc.'</textarea></td>
            </tr>

            <tr>
                <td colspan="2" align="center"><button type="Submit" name="submit" >Submit</button></td>
            </tr>

            </table>


        </form>

    </div>
</div>';
mysql_close($con);

?>